package com.sds.shop.action;

import java.io.IOException;

import javax.servlet.ServletException;
import javax.servlet.http.HttpServletRequest;
import javax.servlet.http.HttpServletResponse;

import com.sds.fw.mvc.Action;
import com.sds.fw.mvc.HttpUtil;
import com.sds.shop.dao.BoardDAO;
import com.sds.shop.vo.BoardVO;

public class SelectBoardAction extends Action {

	@Override
	public void execute(HttpServletRequest request, HttpServletResponse response)
			throws IOException, ServletException {
		BoardVO vo = new BoardVO();
		BoardDAO dao = BoardDAO.getInstance();
		String board_no = request.getParameter("boardNo");
		vo = dao.getBoardDetail(board_no);

		vo.setCount(vo.getCount()+1);
		dao.updateCount(vo.getCount(), vo.getBoardNo());
		
		request.setAttribute("boardDetail", vo);
		HttpUtil.forward(request, response, "/jsp/boarddetail.jsp");

	}

}
